#ifndef _THREAD_H
#define _THREAD_H

//#include "01_Threadpool.hpp"  // 循环包含了
#include <pthread.h>

class ThreadPool;

class Thread
{
private:
    ThreadPool& _threadpool;
    pthread_t _pthid;
    bool _isRunning;

    void run();     // 不走多态了
    static void* start_routine(void*);

public:
    Thread(ThreadPool&);
    //~Thread();    // 析构函数需要写虚函数
    virtual ~Thread();
    void start();
    void join();
    bool joinable();

};

#endif

